repo: Minor cleanup: Move size generation code initialization
authorColin Walters <walters@verbum.org>
Tue, 16 Dec 2014 03:55:56 +0000 (22:55 -0500)
committerColin Walters <walters@verbum.org>
Thu, 18 Dec 2014 23:06:56 +0000 (18:06 -0500)
It has a global effect, so do it in the entrypoint.

src/libostree/ostree-repo-commit.c

index 9d970e4ac85f322192ba2536c6dff26d27e1edd4..6161f2b5e36c305ca0604dbb7be6b5ad4ecd8041 100644 (file)
@@ -2109,11 +2109,6 @@ write_directory_to_mtree_internal (OstreeRepo                  *self,
 
   g_debug ("Examining: %s", gs_file_get_path_cached (dir));
 
-  if (modifier && modifier->flags & OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES)
-    {
-      self->generate_sizes = TRUE;
-    }
-
   /* If the directory is already in the repository, we can try to
    * reuse checksums to skip checksumming. */
   if (OSTREE_IS_REPO_FILE (dir) && modifier == NULL)
@@ -2233,6 +2228,11 @@ ostree_repo_write_directory_to_mtree (OstreeRepo                *self,
   gboolean ret = FALSE;
   GPtrArray *path = NULL;
 
+  if (modifier && modifier->flags & OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES)
+    {
+      self->generate_sizes = TRUE;
+    }
+
   path = g_ptr_array_new ();
   if (!write_directory_to_mtree_internal (self, dir, mtree, modifier, path,
                                           cancellable, error))